<template>
  <div class="search">
    <van-icon class="icon" name="arrow-left" @click="go" />
    <van-search
      class="input"
      v-model="value"
      shape="round"
      placeholder="请输入搜索关键词"
    />
  </div>
  <div class="con">
    <span>手机</span>
    <span>裤子</span>
    <span>短袖</span>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const go = () => {
  router.push({
    name: "index",
  });
};
let num = 1;
let use = [1, 3, 1, 4, 7, 1, 8, 8, 2, 1, 1];
for (let i = 0; i < use.length; i++) {
  if (use[i] == 1) {
    console.log(use[i]);
  }
}
</script>
<style>
.search {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}
.input {
  flex: 1;
}
.icon {
  margin-left: 10px;
}
.con span {
  padding: 5px 10px;
  margin: 10px;
  background-color: #ededed;
  border-radius: 15px;
}
</style>
